package com.hippy.erya.config;

import com.hippy.erya.core.schedue.quartz.StartQuartzExample;
import com.hippy.erya.core.schedue.spring.SpringTasks;
import org.quartz.Scheduler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;


@Configuration
@EnableScheduling
public class SchedulingConfig {


    @Bean
    public SpringTasks scheduledTasks() {
        return new SpringTasks();
    }

    @Bean
    public Scheduler scheduler(SchedulerFactoryBean schedulerFactoryBean) {
        return schedulerFactoryBean.getScheduler();
    }

    @Bean
    public StartQuartzExample startQuartzExample() {
        return new StartQuartzExample();
    }

}
